const mongoose = require('mongoose');
// 实例化一个数据模型
const Schema = mongoose.Schema;

// 创建具体的Schema对象
const UserSchema = new Schema({
    name:{
        type: String,
        required: true
    },
    email:{
        type: String,
        required: true
    },
    password:{
        type: String,
        required: true
    },
    avatar:{
        type: String,
    },
    identity:{
        type: String,
        required: true
    },
    date:{
        type: Date,
        default: Date.now
    }
})

module.exports = User = mongoose.model('users',UserSchema);


